/* 产品表格容器 */
.product-table-container {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* 搜索卡片 */
.search-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-col {
  display: flex;
  gap: 8px;
}

/* 搜索输入框 */
.search-input, .search-select {
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 160px;
  height: 32px;
  box-sizing: border-box;
}

.search-input:hover, .search-select:hover {
  border-color: #40a9ff;
}

.search-input:focus, .search-select:focus {
  border-color: #1890ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.search-select {
  background-color: white;
  cursor: pointer;
}

/* 操作按钮卡片 */
.action-card {
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
  padding: 6px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1.5715;
  font-weight: 400;
  height: 32px;
  box-sizing: border-box;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #1890ff;
  border-color: #1890ff;
  color: white;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}

.btn-primary:hover:not(:disabled) {
  background-color: #40a9ff;
  border-color: #40a9ff;
  box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
}

.btn-default {
  background-color: white;
  border-color: #d9d9d9;
  color: rgba(0, 0, 0, 0.85);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
}

.btn-default:hover:not(:disabled) {
  background-color: #fafafa;
  border-color: #40a9ff;
  color: #40a9ff;
}

.btn-warning {
  background-color: #faad14;
  border-color: #faad14;
  color: white;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}

.btn-warning:hover:not(:disabled) {
  background-color: #ffc53d;
  border-color: #ffc53d;
  box-shadow: 0 4px 8px rgba(250, 173, 20, 0.3);
}

.btn-success {
  background-color: #52c41a;
  border-color: #52c41a;
  color: white;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}

.btn-success:hover:not(:disabled) {
  background-color: #73d13d;
  border-color: #73d13d;
  box-shadow: 0 4px 8px rgba(82, 196, 26, 0.3);
}

.btn-danger {
  background-color: #ff4d4f;
  border-color: #ff4d4f;
  color: white;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}

.btn-danger:hover:not(:disabled) {
  background-color: #ff7875;
  border-color: #ff7875;
  box-shadow: 0 4px 8px rgba(255, 77, 79, 0.3);
}

.btn-sm {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  height: 24px;
}

/* 表格卡片 */
.table-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
  position: relative;
  overflow: hidden;
  min-height: 600px;
  padding-bottom: 70px; /* 为分页留出空间 */
}

/* 表格主体内容 */
.table-main-content {
  flex: 1;
  overflow-x: auto;
  min-width: 0;
}

/* 表格容器 */
.table-container {
  width: 100%;
  height: 100%;
}

/* 表格基础样式 */
.product-table {
  width: 100%;
  min-width: 1520px; /* 增加宽度以包含操作列 */
  border-collapse: collapse;
  font-size: 14px;
  background-color: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
}

/* 移除操作列相关样式，因为操作列已经分离 */

/* 操作按钮组 */
.action-buttons {
  display: flex;
  gap: 4px;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.action-buttons .btn-sm {
  font-size: 11px;
  font-weight: 400;
  padding: 3px 8px;
  margin: 0;
  height: 28px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid transparent;
  text-align: center;
  box-sizing: border-box;
  flex: 1;
}

/* 重新设计按钮样式 */
.action-buttons .btn-primary {
  background-color: #e6f7ff;
  border-color: #91d5ff;
  color: #096dd9;
}
.action-buttons .btn-primary:hover {
  background-color: #bae7ff;
  border-color: #69c0ff;
}

.action-buttons .btn-warning {
  background-color: #fffbe6;
  border-color: #ffe58f;
  color: #d48806;
}
.action-buttons .btn-warning:hover {
  background-color: #fff1b8;
  border-color: #ffd666;
}

.action-buttons .btn-success {
  background-color: #f6ffed;
  border-color: #b7eb8f;
  color: #389e0d;
}
.action-buttons .btn-success:hover {
  background-color: #d9f7be;
  border-color: #95de64;
}

.action-buttons .btn-danger {
  background-color: #fff1f0;
  border-color: #ffa39e;
  color: #cf1322;
}
.action-buttons .btn-danger:hover {
  background-color: #ffccc7;
  border-color: #ff7875;
}

/* 加载状态 */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  padding: 20px 40px;
  border-radius: 8px;
  font-size: 16px;
  color: #1890ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 表格样式 */
.product-table th,
.product-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  line-height: 1.5;
  height: 64px; /* 固定行高 */
  box-sizing: border-box;
  vertical-align: middle;
}

.product-table tbody tr {
  height: 64px; /* 确保tbody行高度 */
}

.product-table th {
  height: 48px; /* 与操作面板头部高度一致 */
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  text-align: left;
}

.product-table tbody tr {
  transition: background-color 0.3s;
}

.product-table tbody tr:hover {
  background-color: #f5f5f5;
}

.product-table tbody tr.selected {
  background-color: #e6f7ff !important;
}

.product-table tbody tr.selected:hover {
  background-color: #d9f7be !important;
}

.product-table tbody tr.hovered {
  background-color: #f5f5f5;
}

/* 产品图片 */
.product-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  transition: all 0.3s;
}

.product-image:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 类别标签 */
.category-tag {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(24, 144, 255, 0.3);
}

/* 状态标签 */
.status-tag {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-tag.active {
  background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
  color: white;
}

.status-tag.inactive {
  background: linear-gradient(135deg, #ff4d4f 0%, #cf1322 100%);
  color: white;
}

/* 产品名称 */
.product-name {
  max-width: 200px;
}

.name-main {
  font-weight: 600;
  color: #262626;
  cursor: pointer;
  margin-bottom: 4px;
  transition: color 0.3s;
}

.name-main:hover {
  color: #1890ff;
}

.name-desc {
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.4;
}

/* 操作按钮组 */
.action-buttons {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 4px;
}

/* 分页 */
.pagination {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.pagination-info {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-info {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.85);
  min-width: 60px;
  text-align: center;
  font-weight: 500;
}

.page-size-select {
  padding: 4px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s;
}

.page-size-select:focus {
  border-color: #1890ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.page-size-select:hover {
  border-color: #40a9ff;
}

/* 数字列右对齐 */
.product-table td:nth-child(9),  /* 入库价 */
.product-table td:nth-child(10), /* 出库价 */
.product-table td:nth-child(11), /* 库存预警 */
.product-table td:nth-child(12)  /* 重量 */ {
  text-align: right;
  font-weight: 500;
}

/* 表头样式优化 */
.product-table th {
  border-right: 1px solid #e8e8e8;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.product-table th:last-child {
  border-right: none;
}

/* 表格单元格优化 */
.product-table td {
  border-right: 1px solid #f5f5f5;
}

.product-table td:last-child {
  border-right: none;
}

/* SKU代码样式 */
.sku-code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  border: 1px solid #e8e8e8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .product-table-container {
    padding: 12px;
  }
  
  .search-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-col {
    width: 100%;
  }
  
  .search-input, .search-select {
    width: 100%;
  }
  
  .action-card {
    padding: 12px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .pagination {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .pagination-controls {
    justify-content: center;
  }
}

.ant-card {
  border-radius: 8px !important;
}

.ant-table-wrapper {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

/* 确保表格在Card中没有多余的边距 */
.ant-card-body .ant-table-wrapper {
    padding: 0;
    border: none;
}

.ant-table-tbody > tr:nth-child(even) > td {
  background: #fafafa;
}

.ant-table-tbody > tr.ant-table-row:hover > td {
  background: #f0f5ff;
}

.table-row-alternate {
  background-color: #fafafa;
}

.table-row-alternate:hover {
  background-color: #e6f7ff !important;
} 